//饿汉模式
public class Peckish {
    private static Peckish instance = new Peckish();

    public static Peckish getInstance(){
        return instance;
    }

    private Peckish(){

    }
}
class Test1 {
    public static void main(String[] args) {
        Peckish s1 = Peckish.getInstance();
        Peckish s2 = Peckish.getInstance();
        System.out.println(s1 == s2);
    }
}
